home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-28 | 1.9 KB | 82 lines | [TEXT/MPS ] |
- // Copyright © 1993-94 Apple Computer, Inc. All rights reserved.
-
- constant kAppSymbol := '|WallyMath:PIEDTS|;
-
- // ---- End Project Data ----
-
-
- // ---- File WallyMath.t ----
- wmApp :=
- {title: "WallyMath",
- viewBounds: {left: -3, top: 34, right: 210, bottom: 199},
- _proto: protoApp,
- debug: "wmApp"
- };
-
- wmMathInput := /* child of wmApp */
- {viewFlags: 133649,
- viewFormat: 337,
- viewlinespacing: 16,
- viewFont: simpleFont12,
- viewBounds: {left: 43, top: 67, right: 193, bottom: 97},
- lastText: "2 + 2 ="
- ,
- xFunc:
- func()
- begin
- self.text;
- end,
- viewChangedScript:
- func(slot, view)
- begin
- if (slot = 'text) then
- if EndsWith(self.text, "=") then
- begin
- try
- self.xfunc := Compile(SubStr(self.text, 0, StrLen(self.text) - 1));
-
- onexception |evt.ex| do //This should actually also catch div 0 but doesn't
- begin
- local e;
- e := CurrentException();
- Print("Error compiling xFunc...");
- :SysBeep();
- self.lastText := Clone(self.text);
- return;
- end;
-
- try
- self.text := NumberStr(Clone(self:xfunc()));
- onexception |evt.ex| do
- begin
- local e;
- e := CurrentException();
- Print("Error calling xFunc...");
- :SysBeep();
- end;
-
- self.lastText := Clone(self.text);
- end;
- end,
- viewclass: 81,
- debug: "wmMathInput"
- };
- // View wmMathInput is declared to wmApp
-
-
-
- _view000 := /* child of wmApp */
- {text: "Expression:",
- viewBounds: {left: 50, top: 50, right: 122, bottom: 66},
- _proto: protoStaticText
- };
-
-
-
-
-
-
-
- // ---- Beginning of section for non used Layout files ----
-
- // End of output